package com.cjw.pojo.dto.userMange;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * @author : cjw
 * @date: : 2022/2/7 14:28
 * @description : 管理员查询用户列表DTO
 */
@Data
public class UserSimpleDTO {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    protected Date addTime;

    private String telephone;

    private String userName;

    private String state;

    private String role;

    public void changeState(Integer state) {
        if (state == 0)
            this.state = "正常";
        else if (state == 1)
            this.state = "封禁";
        else if (state == 2)
            this.state = "注销";
    }
}
